<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./js/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h2>{{title}}</h2>
        <textarea name="" v-model.lazy="title" id="" cols="30" rows="10"></textarea>
        <input type="text " v-model.lazy="title"><br>
        <label for="check">同意服务条款</label><span>{{check}}</span>
        <input type="checkbox" v-model="check" id="check"><br>
        <div>
            <p>我的爱好是{{habit}}</p>
            <label for="game">游戏</label>
            <input type="checkbox" id="game" value="Game" v-model="habit">
            <label for="sleep">睡觉</label>
            <input type="checkbox" id="sleep" value="Sleep" v-model="habit">
            <label for="phone">玩手机</label>
            <input type="checkbox" id="phone" value="Phone" v-model="habit">
        </div>
        <div>
            <p>请选择你的性别: {{pick}}</p>
            <!-- <label for="male">男性</label> -->
            <input type="radio" id="male" value="1" v-model="pick">男
            <!-- <label for="female">女性</label> -->
            <input type="radio" id="female" value="2" v-model="pick">女
            <!-- <label for="nomale">变性</label> -->
            <input type="radio" id="nomale" value="3" v-model="pick">妖
        </div>
        <div>
            <p>选择你喜欢的城市: {{choose}}</p>
            <select v-model="choose">
                <option value="">请选择</option>
                <option :value="l.code" v-for="(l,i) in cities"> {{l.name }}</option>
            </select>
        </div>
        <div>
            <p>你喜欢的动物是: {{love}}</p>
            <p>
                <input type="radio" :value="a" v-model="love"> 猫
                <input type="radio" :value="b" v-model="love"> 狗
                <input type="radio" :value="c" v-model="love"> 老鼠

            </p>
        </div>
    </div>
</body>
<script>
    const vm = new Vue({
        el: "#app",
        data: {
            title: "好好学习!学好Vue",
            check: "",
            habit: [],
            pick: "",
            cities: [
                {
                    name: '北京',
                    code: "BJ"
                },
                {
                    name: '成都',
                    code: "CD"
                },
                {
                    name: '武汉',
                    code: "WH"
                },
                {
                    name: '上海',
                    code: "SH"
                },
                {
                    name: '拉萨',
                    code: "LS"
                }
            ],
            choose: "",
            love: "",
            a: "Cat",
            b: "Dog",
            c: "Mouse"
        }
    })
</script>

</html>